<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <!-- 页面中有多个一样结构的标签: span+button -->
        <span>{{count1}}</span> <button @click="changeCount1">按钮</button> <br>

        <span>{{count2}}</span> <button @click="changeCount2">按钮</button> <br>

        <span>{{count3}}</span> <button @click="changeCount3">按钮</button> <br>

        <span>{{count4}}</span> <button @click="changeCount4">按钮</button> <br>

        <span>{{count5}}</span> <button @click="changeCount5">按钮</button> <br>
    </div>
    <script src="./vue.js"></script>
    <script>
        new Vue({
            el: '#app',
            data: {
                count1: 0,
                count2: 0,
                count3: 0,
                count4: 0,
                count5: 0
            },
            methods: {
                changeCount1() {
                    this.count1++;
                },
                changeCount2() {
                    this.count2++;
                },
                changeCount3() {
                    this.count3++;
                },
                changeCount4() {
                    this.count4++;
                },
                changeCount5() {
                    this.count5++;
                }
            }
        });
    </script>
</body>

</html>